[x, y] = syms("x y");

symint(cos(x))

symint(log(x + y), x)

symint(exp(-x), 0, inf)

symint(2*x, sin(y), cos(y))

symint(symint(exp(-x^2 - y^2), x, -inf, inf), y, -inf, inf)

M = sym(zeros(2, 2));
M{0, 0} = exp(y);
M{0, 1} = exp(x * y);
M{1, 0} = sin(y);
M{1, 1} = cos(x);
symint(M, y)
symint(M, y, "IgnoreSpecialCases", true)

symint(x*exp(x), "Hold", true)

symint(x^2/(x^2 - 4)/(x^2 + 9), x, 0, inf, "PrincipalValue", true)

% 测试 Cauchy 主值是否对不定积分和变限积分忽略
symint(1/(x - 1))
symint(1/(x - 1), x)
symint(1/(x - 1), 0, 2)
symint(1/(x - 1), 0, sin(y))
symint(1/(x - 1), exp(y), 2)
symint(1/(x - 1), exp(y), sin(y))
symint(1/(x - 1), x, 0, 2)
symint(1/(x - 1), x, 0, sin(y))
symint(1/(x - 1), x, exp(y), 2)
symint(1/(x - 1), x, exp(y), sin(y))
symint(1/(x - 1), "PrincipalValue", true)
symint(1/(x - 1), x, "PrincipalValue", true)
symint(1/(x - 1), 0, 2, "PrincipalValue", true)
symint(1/(x - 1), 0, sin(y), "PrincipalValue", true)
symint(1/(x - 1), exp(y), 2, "PrincipalValue", true)
symint(1/(x - 1), exp(y), sin(y), "PrincipalValue", true)
symint(1/(x - 1), x, 0, 2, "PrincipalValue", true)
symint(1/(x - 1), x, 0, sin(y), "PrincipalValue", true)
symint(1/(x - 1), x, exp(y), 2, "PrincipalValue", true)
symint(1/(x - 1), x, exp(y), sin(y), "PrincipalValue", true)

% 忽略解析限制
symint(asin(sin(x)), x, 0, 5)
symint(asin(sin(x)), x, 0, 5, "IgnoreAnalyticConstraints", true)
